package com.tbit.uqbike.client.service;

import com.tbit.uqbike.client.pojo.Recharge;
import com.tbit.uqbike.client.pojo.User;
import com.tbit.uqbike.client.pojo.WeixinDepositLog;
import com.tbit.uqbike.client.pojo.payPal.PayPalEntity;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * @Author: chen
 * @Description: payPay支付
 * @Date: 创建于 14:00 2020/1/10
 */
public interface PayPalService {
    /**
     * 创建订单
     */
    Map<String, Object> getOrder(PayPalEntity payPalEntity, Integer adAccountId);

    /**
     * paypal回调处理
     *
     * @param request
     */
    String callBack(HttpServletRequest request, HttpServletResponse response);

    /**
     * app回调扣款
     *
     * @param
     * @return
     */
    Map<String, Object> callBackFromApp(String token, String orderNO, Double money, String nonce,
                                        Integer accountId);

    /**
     * 更新订单状态并绑定用户租车或充值信息
     *
     * @param recharge 订单
     * @param user     绑定用户信息
     * @param transId  交易流水号
     */
    void updateOrderAndBing(Recharge recharge, User user, String transId);

    /**
     * 创建免押会员订单
     *
     * @param payPalEntity
     * @return
     */
    Map<String, Object> createOrder_memberFee(PayPalEntity payPalEntity, Integer memberFeeId,
                                              Integer adAccountId);

    /**
     * 骑行会员
     *
     * @param payPalEntity
     * @param rideCardId
     * @return
     */
    Map<String, Object> createOrder_rideCard(PayPalEntity payPalEntity, Integer rideCardId,
                                             Integer adAccountId);

    /**
     * 退还押金
     *
     * @param
     * @return
     */
    String returnDeposit(User user, WeixinDepositLog weixinDepositLog);

    /**
     * 骑行会员
     *
     * @param payPalEntity
     * @param vipId
     * @return
     */
    Map<String, Object> createOrder_vipOrder(PayPalEntity payPalEntity, Integer vipId,
                                             Integer adAccountId);


}
